cdrdao.paketlendi

This commit is contained in:
giresun28 2016-09-22 21:01:39 +00:00
parent 41e7f8592c
commit da8870a33b
20 changed files with 983 additions and 11 deletions

View File

@ -19,9 +19,16 @@ Kısaca Milis,sanal dünyanın getirisi olarak hakkımız olan kaybettiğimiz bi
Ayrıca her türlü katkıda bulunmak isteyenler için bulunmaz bir türkçe açık kaynak projesidir.
milis anasayfa : http://milis.gungre.ch
Milis Anasayfa : http://milis.gungre.ch
iletişim: milisarge@gmail.com irc.freenode.net #milisarge
İletişim: milisarge@gmail.com irc.freenode.net #milisarge
Telegram duyuru kanalımız: http://telegram.me/milislinux
<<<<<<< HEAD
telegram kanalımız: telegram.me/milislinux
=======
>>>>>>> 2e12c116cf412d456c851e84f392c039690d1cc6
Sunucu desteği için Lucas Sköldqvist dostumuza teşekkür ederiz.

40
bin/milis-kurucu.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
#Milis-Linux kurulum yardımcısı
umount /mnt
clear
echo "Milis Linux Kurulumu"
echo ""
echo "Yeni kullanıcı adını giriniz:"
read user
useradd $user
passwd $user
clear
echo "Milis Linux Kurulumu"
echo ""
echo "hangi diske kurulum yapacaksınız:"
ls /dev/sd*
read disk
clear
echo "Milis Linux Kurulumu"
echo ""
echo "Grubu nereye kuracaksınız:"
ls /dev/sd*
read grub
clear
echo "Milis Linux Kurulumu"
echo ""
echo "Kurulum başlıyor"
mkfs.ext4 /dev/$disk
mount $disk /mnt
echo "Dosyalar Kopyalanıyor"
cp -axvnu / /mnt
echo "Kernel ayarları yapılıyor"
chroot /mnt dracut --no-hostonly --add-drivers "ahci" -f /boot/initramfs
echo "Grub ayarlanıyor"
grub-install --boot-directory=/mnt/boot /$grub
grub-mkconfig -o /mnt/boot/grub/grub.cfg
clear
echo "Milis Linux Kurulumu"
echo ""
clear
echo "Milis kuruldu bilgisayarınızı yeniden başlatınız..."

View File

@ -693,7 +693,13 @@ git_guncelle() {
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/bin/ `dirname $talimatname_dizin`/bin
rm -r `dirname $talimatname_dizin`/ayarlar/*
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/ayarlar/ `dirname $talimatname_dizin`/ayarlar
ln -s /root/bin/* /usr/bin/
#ikili dosyaların /usr/bin altına kısayol atılması
for i in /root/bin/*; do
j=`basename $i`
if [ ! -f /usr/bin/$j ];then
ln -s /root/bin/$j /usr/bin/$j
fi
done
}
paketvt_guncelle(){

1
bin/qemu_ekran_kaydet.sh Executable file
View File

@ -0,0 +1 @@
flvrec.py -o video.flv 127.0.0.1:0

1
bin/video_cek.sh Normal file
View File

@ -0,0 +1 @@
ffmpeg -video_size 1024x768 -framerate 20 -f x11grab -i :0.0 -c:v libvpx -crf 4 -b:v 1M video.webm

1
qemu-vnc.sh Executable file
View File

@ -0,0 +1 @@
qemu-system-x86_64 --enable-kvm -bios OVMF.fd -m 1024 -vnc 127.0.0.1:0 $1

View File

@ -0,0 +1,679 @@
diff -rup coreutils-8.24/src/copy.c coreutils-8.24-patched/src/copy.c
--- coreutils-8.24/src/copy.c 2015-06-26 11:05:22.000000000 -0600
+++ coreutils-8.24-patched/src/copy.c 2015-07-09 15:39:58.000000000 -0600
@@ -117,6 +117,71 @@ struct dir_list
dev_t dev;
};
+struct progress_status {
+ int iCountDown;
+ char ** cProgressField;
+ struct timeval last_time;
+ int last_size, iBarLength;
+ struct stat src_open_sb;
+};
+
+/* Begin progress Mod*/
+static void file_progress_bar ( char * _cDest, int _iBarLength, long _lProgress, long _lTotal )
+{
+ double dPercent = (double) _lProgress / (double) _lTotal * 100.f;
+ sprintf( _cDest + ( _iBarLength - 6), "%4.1f", dPercent );
+ _cDest[_iBarLength - 2] = ' ';
+
+ int i;
+ for ( i=1; i<=_iBarLength - 9; i++)
+ {
+ if ( dPercent > (double) (i-1) / (_iBarLength - 10) * 100.f )
+ {
+ _cDest[i] = '=';
+ }
+ else
+ {
+ _cDest[i] = ' ';
+ }
+ }
+ for ( i=1; i<_iBarLength - 9; i++)
+ {
+ if ( ( _cDest[i+1] == ' ' ) && ( _cDest[i] == '=' ) )
+ _cDest[i] = '>' ;
+ }
+}
+
+int file_size_format ( char * _cDst, long _lSize, int _iCounter )
+{
+ int iCounter = _iCounter;
+ double dSize = ( double ) _lSize;
+ while ( dSize >= 1000. )
+ {
+ dSize /= 1024.;
+ iCounter++;
+ }
+
+ /* get unit */
+ char * sUnit;
+ if ( iCounter == 0 )
+ sUnit = "B";
+ else if ( iCounter == 1 )
+ sUnit = "KiB";
+ else if ( iCounter == 2 )
+ sUnit = "MiB";
+ else if ( iCounter == 3 )
+ sUnit = "GiB";
+ else if ( iCounter == 4 )
+ sUnit = "TiB";
+ else
+ sUnit = "N/A";
+
+ /* write number */
+ return sprintf ( _cDst, "%5.1f %s", dSize, sUnit );
+}
+/* END progress mod */
+
+
/* Initial size of the cp.dest_info hash table. */
#define DEST_INFO_INITIAL_CAPACITY 61
@@ -212,7 +277,8 @@ sparse_copy (int src_fd, int dest_fd, ch
size_t hole_size, bool punch_holes,
char const *src_name, char const *dst_name,
uintmax_t max_n_read, off_t *total_n_read,
- bool *last_write_made_hole)
+ bool *last_write_made_hole,
+ struct progress_status *s_progress)
{
*last_write_made_hole = false;
*total_n_read = 0;
@@ -221,6 +287,83 @@ sparse_copy (int src_fd, int dest_fd, ch
while (max_n_read)
{
+
+ if (progress) {
+ /* BEGIN progress mod */
+ /* update countdown */
+ s_progress->iCountDown--;
+ char * sProgressBar = s_progress->cProgressField[5];
+ if ( s_progress->iCountDown < 0 )
+ s_progress->iCountDown = 100;
+
+ /* just print one line with the percentage, but not always */
+ if ( s_progress->iCountDown == 0 )
+ {
+ /* calculate current speed */
+ struct timeval cur_time;
+ gettimeofday ( & cur_time, NULL );
+ int cur_size = g_iTotalWritten + *total_n_read / 1024;
+ int usec_elapsed = cur_time.tv_usec - s_progress->last_time.tv_usec;
+ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
+ sec_elapsed += ( double ) ( cur_time.tv_sec - s_progress->last_time.tv_sec );
+ int copy_speed = ( int ) ( ( double ) ( cur_size - s_progress->last_size )
+ / sec_elapsed );
+ char s_copy_speed[20];
+ file_size_format ( s_copy_speed, copy_speed, 1 );
+ /* update vars */
+ s_progress->last_time = cur_time;
+ s_progress->last_size = cur_size;
+
+ /* how many time has passed since the start? */
+ int isec_elapsed = cur_time.tv_sec - g_oStartTime.tv_sec;
+ int sec_remaining = ( int ) ( ( double ) isec_elapsed / cur_size
+ * g_iTotalSize ) - isec_elapsed;
+ int min_remaining = sec_remaining / 60;
+ sec_remaining -= min_remaining * 60;
+ int hours_remaining = min_remaining / 60;
+ min_remaining -= hours_remaining * 60;
+ /* print out */
+ sprintf ( s_progress->cProgressField[3],
+ "Copying at %s/s (about %uh %um %us remaining)", s_copy_speed,
+ hours_remaining, min_remaining, sec_remaining );
+
+ int fs_len;
+ if ( g_iTotalFiles > 1 )
+ {
+ /* global progress bar */
+ file_progress_bar ( s_progress->cProgressField[2], s_progress->iBarLength,
+ g_iTotalWritten + *total_n_read / 1024, g_iTotalSize );
+
+ /* print the global status */
+ fs_len = file_size_format ( s_progress->cProgressField[1] + s_progress->iBarLength - 21,
+ g_iTotalWritten + *total_n_read / 1024, 1 );
+ s_progress->cProgressField[1][s_progress->iBarLength - 21 + fs_len] = ' ';
+ }
+
+ /* current progress bar */
+ file_progress_bar ( sProgressBar, s_progress->iBarLength, *total_n_read, s_progress->src_open_sb.st_size );
+
+ /* print the status */
+ fs_len = file_size_format ( s_progress->cProgressField[4] + s_progress->iBarLength - 21, *total_n_read, 0 );
+ s_progress->cProgressField[4][s_progress->iBarLength - 21 + fs_len] = ' ';
+
+ /* print the field */
+ int it;
+ for ( it = g_iTotalFiles>1 ? 0 : 3; it < 6; it++ )
+ {
+ printf ( "\033[K%s\n", s_progress->cProgressField[it] );
+ if ( strlen ( s_progress->cProgressField[it] ) < s_progress->iBarLength )
+ printf ( "" );
+ }
+ if ( g_iTotalFiles > 1 )
+ printf ( "\r\033[6A" );
+ else
+ printf ( "\r\033[3A" );
+ fflush ( stdout );
+ }
+ /* END progress mod */
+ }
+
ssize_t n_read = read (src_fd, buf, MIN (max_n_read, buf_size));
if (n_read < 0)
{
@@ -316,6 +459,14 @@ sparse_copy (int src_fd, int dest_fd, ch
certain files in /proc or /sys with linux kernels. */
}
+ /* BEGIN progress mod */
+ if (progress) {
+ /* update total size */
+ g_iTotalWritten += *total_n_read / 1024;
+ g_iFilesCopied++;
+ }
+ /* END progress mod */
+
/* Ensure a trailing hole is created, so that subsequent
calls of sparse_copy() start at the correct offset. */
if (make_hole && ! create_hole (dest_fd, dst_name, punch_holes, psize))
@@ -388,7 +539,9 @@ extent_copy (int src_fd, int dest_fd, ch
size_t hole_size, off_t src_total_size,
enum Sparse_type sparse_mode,
char const *src_name, char const *dst_name,
- bool *require_normal_copy)
+ bool *require_normal_copy,
+ int iCountDown, char ** cProgressField, struct timeval last_time,
+ int last_size, int iBarLength, struct stat src_open_sb)
{
struct extent_scan scan;
off_t last_ext_start = 0;
@@ -504,10 +657,15 @@ extent_copy (int src_fd, int dest_fd, ch
empty_extent = false;
last_ext_len = ext_len;
+ struct timeval a;
+ struct stat b;
+
+ struct progress_status s_progress={iCountDown, cProgressField, last_time, last_size, iBarLength, src_open_sb};
+
if ( ! sparse_copy (src_fd, dest_fd, buf, buf_size,
sparse_mode == SPARSE_ALWAYS ? hole_size: 0,
true, src_name, dst_name, ext_len, &n_read,
- &wrote_hole_at_eof))
+ &wrote_hole_at_eof, &s_progress))
goto fail;
dest_pos = ext_start + n_read;
@@ -982,7 +1140,6 @@ is_probably_sparse (struct stat const *s
&& ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE);
}
-
/* Copy a regular file from SRC_NAME to DST_NAME.
If the source file contains holes, copies holes and blocks of zeros
in the source file as holes in the destination file.
@@ -1258,6 +1415,72 @@ copy_reg (char const *src_name, char con
buf_alloc = xmalloc (buf_size + buf_alignment_slop);
buf = ptr_align (buf_alloc, buf_alignment);
+ /* BEGIN progress mod */
+ /* create a field of 6 lines */
+ char ** cProgressField = ( char ** ) calloc ( 6, sizeof ( char * ) );
+ /* get console width */
+ int iBarLength = 80;
+ struct winsize win;
+ if ( ioctl (STDOUT_FILENO, TIOCGWINSZ, (char *) &win) == 0 && win.ws_col > 0 )
+ iBarLength = win.ws_col;
+ /* create rows */
+ int it;
+ for ( it = 0; it < 6; it++ )
+ {
+ cProgressField[it] = ( char * ) malloc ( iBarLength + 1 );
+ /* init with spaces */
+ int j;
+ for ( j = 0; j < iBarLength; j++ )
+ cProgressField[it][j] = ' ';
+ cProgressField[it][iBarLength] = '\0';
+ }
+
+ /* global progress bar? */
+ if ( g_iTotalFiles > 1 )
+ {
+ /* init global progress bar */
+ cProgressField[2][0] = '[';
+ cProgressField[2][iBarLength - 8] = ']';
+ cProgressField[2][iBarLength - 7] = ' ';
+ cProgressField[2][iBarLength - 1] = '%';
+
+ /* total size */
+ cProgressField[1][iBarLength - 11] = '/';
+ file_size_format ( cProgressField[1] + iBarLength - 9, g_iTotalSize, 1 );
+
+ /* show how many files were written */
+ int sum_length = sprintf ( cProgressField[1], "%d files copied so far...", g_iFilesCopied );
+ cProgressField[1][sum_length] = ' ';
+ }
+
+ /* truncate filename? */
+ int fn_length;
+ if ( strlen ( src_name ) > iBarLength - 22 )
+ fn_length =
+ sprintf ( cProgressField[4], "...%s", src_name + ( strlen ( src_name ) - iBarLength + 25 ) );
+ else
+ fn_length = sprintf ( cProgressField[4], "%s", src_name );
+ cProgressField[4][fn_length] = ' ';
+
+ /* filesize */
+ cProgressField[4][iBarLength - 11] = '/';
+ file_size_format ( cProgressField[4] + iBarLength - 9, src_open_sb.st_size, 0 );
+
+ int iCountDown = 1;
+ char * sProgressBar = cProgressField[5];
+ sProgressBar[0] = '[';
+ sProgressBar[iBarLength - 8] = ']';
+ sProgressBar[iBarLength - 7] = ' ';
+ sProgressBar[iBarLength - 1] = '%';
+
+ /* this will always save the time in between */
+ struct timeval last_time;
+ gettimeofday ( & last_time, NULL );
+ int last_size = g_iTotalWritten;
+ /* END progress mod */
+
+
+
if (sparse_src)
{
bool normal_copy_required;
@@ -1269,7 +1492,9 @@ copy_reg (char const *src_name, char con
if (extent_copy (source_desc, dest_desc, buf, buf_size, hole_size,
src_open_sb.st_size,
make_holes ? x->sparse_mode : SPARSE_NEVER,
- src_name, dst_name, &normal_copy_required))
+ src_name, dst_name, &normal_copy_required,
+ iCountDown, cProgressField, last_time, last_size,
+ iBarLength, src_open_sb))
goto preserve_metadata;
if (! normal_copy_required)
@@ -1281,11 +1506,12 @@ copy_reg (char const *src_name, char con
off_t n_read;
bool wrote_hole_at_eof;
+ struct progress_status s_progress = { iCountDown, cProgressField, last_time, last_size, iBarLength, src_open_sb};
if (! sparse_copy (source_desc, dest_desc, buf, buf_size,
make_holes ? hole_size : 0,
x->sparse_mode == SPARSE_ALWAYS, src_name, dst_name,
UINTMAX_MAX, &n_read,
- &wrote_hole_at_eof))
+ &wrote_hole_at_eof, &s_progress))
{
return_val = false;
goto close_src_and_dst_desc;
@@ -1296,6 +1522,15 @@ copy_reg (char const *src_name, char con
return_val = false;
goto close_src_and_dst_desc;
}
+
+ /* BEGIN progress mod */
+ if (progress) {
+ int i;
+ for ( i = 0; i < 6; i++ )
+ free ( cProgressField[i] );
+ free ( cProgressField );
+ }
+ /* END progress mod */
}
preserve_metadata:
@@ -1396,6 +1631,7 @@ close_src_desc:
free (buf_alloc);
free (name_alloc);
+
return return_val;
}
diff -rup coreutils-8.24/src/copy.h coreutils-8.24-patched/src/copy.h
--- coreutils-8.24/src/copy.h 2015-06-26 11:04:19.000000000 -0600
+++ coreutils-8.24-patched/src/copy.h 2015-07-09 15:05:07.000000000 -0600
@@ -231,6 +231,9 @@ struct cp_options
Create destination directories as usual. */
bool symbolic_link;
+ /* If true, draw a nice progress bar on screen */
+ bool progress_bar;
+
/* If true, do not copy a nondirectory that has an existing destination
with the same or newer modification time. */
bool update;
@@ -289,4 +292,16 @@ void cp_options_default (struct cp_optio
bool chown_failure_ok (struct cp_options const *) _GL_ATTRIBUTE_PURE;
mode_t cached_umask (void);
+
+/* BEGIN OF PROGRESS MOD */
+int file_size_format ( char * _cDst, long _lSize, int _iCounter );
+
+long g_iTotalSize;
+long g_iTotalWritten;
+int g_iFilesCopied;
+struct timeval g_oStartTime;
+int g_iTotalFiles;
+bool progress;
+/* END OF PROGRESS MOD */
+
#endif
diff -rup coreutils-8.24/src/cp.c coreutils-8.24-patched/src/cp.c
--- coreutils-8.24/src/cp.c 2015-06-26 11:04:19.000000000 -0600
+++ coreutils-8.24-patched/src/cp.c 2015-07-09 15:05:07.000000000 -0600
@@ -140,6 +140,7 @@ static struct option const long_opts[] =
{"symbolic-link", no_argument, NULL, 's'},
{"target-directory", required_argument, NULL, 't'},
{"update", no_argument, NULL, 'u'},
+ {"progress-bar", no_argument, NULL, 'g'},
{"verbose", no_argument, NULL, 'v'},
{GETOPT_SELINUX_CONTEXT_OPTION_DECL},
{GETOPT_HELP_OPTION_DECL},
@@ -179,6 +180,7 @@ Copy SOURCE to DEST, or multiple SOURCE(
-f, --force if an existing destination file cannot be\n\
opened, remove it and try again (this option\n\
is ignored when the -n option is also used)\n\
+ -g, --progress-bar add a progress bar\n\
-i, --interactive prompt before overwrite (overrides a previous -n\
\n\
option)\n\
@@ -625,6 +627,72 @@ do_copy (int n_files, char **file, const
quote (file[n_files - 1]));
}
+ struct timeval start_time;
+ if (progress) {
+ /* BEGIN progress mod */
+ g_iTotalSize = 0;
+ g_iTotalFiles = 0;
+ g_iFilesCopied = 0;
+ g_iTotalWritten = 0;
+
+ /* save time */
+ gettimeofday ( & start_time, NULL );
+ g_oStartTime = start_time;
+
+ printf ( "Calculating total size... \r" );
+ fflush ( stdout );
+ long iTotalSize = 0;
+ int iFiles = n_files;
+ if ( ! target_directory )
+ iFiles = n_files - 1;
+ int j;
+
+ /* how many files are we copying */
+ char command[1024];
+ sprintf( command, "find \"%s\" -type f | wc -l", file[0]);
+ FILE *fp ;
+ char output[1024];
+ fp = popen(command,"r");
+ if ( fp == NULL || fgets(output, sizeof(output)-1, fp) == NULL)
+ printf("failed to run find.\n");
+ else
+ g_iTotalFiles = atoi( output ) ;
+
+ for (j = 0; j < iFiles; j++)
+ {
+ /* call du -s for each file */
+ /* create command */
+ char command[1024];
+ sprintf ( command, "du -s \"%s\"", file[j] );
+ /* TODO: replace all quote signs in file[i] */
+
+ FILE *fp;
+ char output[1024];
+
+ /* run command */
+ fp = popen(command, "r");
+ if (fp == NULL || fgets(output, sizeof(output)-1, fp) == NULL) {
+ printf("failed to run du.\n" );
+ }
+ else
+ {
+ /* isolate size */
+ strchr ( output, '\t' )[0] = '\0';
+ iTotalSize += atol ( output );
+
+ printf ( "Calculating total size... %ld\r", iTotalSize );
+ fflush ( stdout );
+ }
+
+ /* close */
+ pclose(fp);
+ }
+ g_iTotalSize = iTotalSize;
+ /* END progress mod */
+ }
+
+
+
if (target_directory)
{
/* cp file1...filen edir
@@ -767,6 +835,47 @@ do_copy (int n_files, char **file, const
ok = copy (source, new_dest, 0, x, &unused, NULL);
}
+ if (progress) {
+ /* BEGIN progress mod */
+ /* remove everything */
+ int i;
+ if ( g_iTotalFiles > 1 )
+ {
+ for ( i = 0; i < 6; i++ )
+ printf ( "\033[K\n" );
+ printf ( "\r\033[6A" );
+ }
+ else
+ {
+ for ( i = 0; i < 3; i++ )
+ printf ( "\033[K\n" );
+ printf ( "\r\033[3A" );
+ }
+
+ /* save time */
+ struct timeval end_time;
+ gettimeofday ( & end_time, NULL );
+ int usec_elapsed = end_time.tv_usec - start_time.tv_usec;
+ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
+ sec_elapsed += ( double ) ( end_time.tv_sec - start_time.tv_sec );
+
+ /* get total size */
+ char sTotalWritten[20];
+ file_size_format ( sTotalWritten, g_iTotalSize, 1 );
+ /* TODO: using g_iTotalWritten would be more correct, but is less accurate */
+
+ /* calculate speed */
+ int copy_speed = ( int ) ( ( double ) g_iTotalWritten / sec_elapsed );
+ char s_copy_speed[20];
+ file_size_format ( s_copy_speed, copy_speed, 1 );
+
+ /* good-bye message */
+ printf ( "%d files (%s) copied in %.1f seconds (%s/s).\n", g_iFilesCopied, sTotalWritten,
+ sec_elapsed, s_copy_speed );
+ /* END progress mod */
+ }
+
+
return ok;
}
@@ -801,6 +910,7 @@ cp_option_init (struct cp_options *x)
x->recursive = false;
x->sparse_mode = SPARSE_AUTO;
x->symbolic_link = false;
+ x->progress_bar = false;
x->set_mode = false;
x->mode = 0;
@@ -943,7 +1053,7 @@ main (int argc, char **argv)
we'll actually use backup_suffix_string. */
backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
- while ((c = getopt_long (argc, argv, "abdfHilLnprst:uvxPRS:TZ",
+ while ((c = getopt_long (argc, argv, "abdfgHilLnprst:uvxPRS:TZ",
long_opts, NULL))
!= -1)
{
@@ -1000,6 +1110,10 @@ main (int argc, char **argv)
x.unlink_dest_after_failed_open = true;
break;
+ case 'g':
+ progress = true;
+ break;
+
case 'H':
x.dereference = DEREF_COMMAND_LINE_ARGUMENTS;
break;
diff -rup coreutils-8.24/src/mv.c coreutils-8.24-patched/src/mv.c
--- coreutils-8.24/src/mv.c 2015-06-26 11:04:19.000000000 -0600
+++ coreutils-8.24-patched/src/mv.c 2015-07-09 15:05:07.000000000 -0600
@@ -65,6 +65,7 @@ static struct option const long_options[
{"target-directory", required_argument, NULL, 't'},
{"update", no_argument, NULL, 'u'},
{"verbose", no_argument, NULL, 'v'},
+ {"progress-ar", no_argument, NULL, 'g'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
{NULL, 0, NULL, 0}
@@ -164,10 +165,98 @@ target_directory_operand (char const *fi
static bool
do_move (const char *source, const char *dest, const struct cp_options *x)
{
+
+ struct timeval start_time;
+
+ if(progress) {
+ /* BEGIN progress mod */
+ g_iTotalSize = 0;
+ g_iFilesCopied = 0;
+ g_iTotalWritten = 0;
+
+ gettimeofday (& start_time, NULL);
+ g_oStartTime = start_time;
+
+ printf ("Calculating total size... \r");
+ fflush (stdout);
+ long iTotalSize = 0;
+ /* call du -s for each file */
+ /* create command */
+ char command[1024];
+ sprintf ( command, "du -s \"%s\"", source );
+ /* TODO: replace all quote signs in file[i] */
+
+ FILE *fp;
+ char output[1024];
+
+ /* run command */
+ fp = popen(command, "r");
+ if (fp == NULL || fgets(output, sizeof(output)-1, fp) == NULL) {
+ printf("failed to run du.\n" );
+ }
+ else
+ {
+ /* isolate size */
+ strchr ( output, '\t' )[0] = '\0';
+ iTotalSize += atol ( output );
+ printf ( "Calculating total size... %ld\r", iTotalSize );
+ fflush ( stdout );
+ }
+
+ /* close */
+ pclose(fp);
+ g_iTotalSize = iTotalSize;
+ /* END progress mod */
+
+ }
+
+
+
bool copy_into_self;
bool rename_succeeded;
bool ok = copy (source, dest, false, x, &copy_into_self, &rename_succeeded);
+ if (progress) {
+ /* BEGIN progress mod */
+ /* remove everything */
+ int i;
+ if ( g_iTotalFiles > 1 )
+ {
+ for ( i = 0; i < 6; i++ )
+ printf ( "\033[K\n" );
+ printf ( "\r\033[6A" );
+ }
+ else
+ {
+ for ( i = 0; i < 3; i++ )
+ printf ( "\033[K\n" );
+ printf ( "\r\033[3A" );
+ }
+
+ /* save time */
+ struct timeval end_time;
+ gettimeofday ( & end_time, NULL );
+ int usec_elapsed = end_time.tv_usec - start_time.tv_usec;
+ double sec_elapsed = ( double ) usec_elapsed / 1000000.f;
+ sec_elapsed += ( double ) ( end_time.tv_sec - start_time.tv_sec );
+
+ /* get total size */
+ char sTotalWritten[20];
+ file_size_format ( sTotalWritten, g_iTotalSize, 1 );
+ /* TODO: using g_iTotalWritten would be more correct, but is less accurate */
+
+ /* calculate speed */
+ int copy_speed = ( int ) ( ( double ) g_iTotalWritten / sec_elapsed );
+ char s_copy_speed[20];
+ file_size_format ( s_copy_speed, copy_speed, 1 );
+
+ /* good-bye message */
+ printf ( "%d files (%s) moved in %.1f seconds (%s/s).\n", g_iFilesCopied, sTotalWritten,
+ sec_elapsed, s_copy_speed );
+ /* END progress mod */
+ }
+
+
if (ok)
{
char const *dir_to_remove;
@@ -302,6 +391,7 @@ Rename SOURCE to DEST, or move SOURCE(s)
\n\
-b like --backup but does not accept an argument\n\
-f, --force do not prompt before overwriting\n\
+ -g, --progress-bar add progress-bar\n\
-i, --interactive prompt before overwrite\n\
-n, --no-clobber do not overwrite an existing file\n\
If you specify more than one of -i, -f, -n, only the final one takes effect.\n\
@@ -373,7 +463,7 @@ main (int argc, char **argv)
we'll actually use backup_suffix_string. */
backup_suffix_string = getenv ("SIMPLE_BACKUP_SUFFIX");
- while ((c = getopt_long (argc, argv, "bfint:uvS:TZ", long_options, NULL))
+ while ((c = getopt_long (argc, argv, "bfint:uvgS:TZ", long_options, NULL))
!= -1)
{
switch (c)
@@ -419,6 +509,11 @@ main (int argc, char **argv)
case 'v':
x.verbose = true;
break;
+
+ case 'g':
+ progress = true;
+ break;
+
case 'S':
make_backups = true;
backup_suffix_string = optarg;

View File

@ -0,0 +1,29 @@
# Description: cp and mv utilities with progress bar patches
# URL: https://www.gnu.org/software/coreutils/
# Packager: milisarge
# Depends on:
name=advcp
_name=coreutils
version=8.24
release=1
source=(ftp://ftp.gnu.org/gnu/$_name/$_name-$version.tar.xz
advcpmv-${version}.patch)
build() {
export FORCE_UNSAFE_CONFIGURE=1
cd ${SRC}/${_name}-${version}
patch -p1 -i ${SRC}/advcpmv-${version}.patch
./configure --prefix=/usr \
--libexecdir=/usr/lib \
--enable-no-install-program=groups,hostname,kill,uptime
make $MAKEFLAGS -j1
cd ${SRC}/${_name}-${version}
install -D src/cp ${PKG}/usr/bin/acp
install -D src/mv ${PKG}/usr/bin/amv
}

View File

@ -0,0 +1,2 @@
export PATH=/opt/OpenJDK-8u60-bin/jre/bin/:$PATH
exec /usr/share/arduino/arduino "$@"

View File

@ -0,0 +1,44 @@
# Description: Arduino prototyping platform SDK
# URL: https://github.com/arduino/Arduino
# Packager: milisarge
# Depends on : gtk2 desktop-file-utils shared-mime-info openjdk avrdude apache-ant unzip
name=arduino
version=1.6.11
release=1
source=(https://github.com/arduino/Arduino/archive/$version.tar.gz
arduino.sh)
build() {
cd "Arduino-${version}/build"
export PATH=/opt/OpenJDK-8u60-bin/jre/bin/:$PATH
ant clean build
cd ${SRC}/"Arduino-${version}/build/linux/work"
# Create directories
install -dm755 "${PKG}/usr/share/"{doc,icons/hicolor,applications,mime/packages}
# Copy the whole SDK
cp -a . "${PKG}/usr/share/arduino"
# Create wrapper for java8 + buider and documentation symlink
install -Dm755 "${SRC}/arduino.sh" "${PKG}/usr/bin/arduino"
ln -s /usr/share/arduino/arduino-builder "${PKG}/usr/bin/arduino-builder"
ln -s /usr/share/arduino/reference "${PKG}/usr/share/doc/arduino"
# Fix avrdude (see https://github.com/arduino/Arduino/issues/5094)
rm -f "${PKG}/usr/share/arduino/hardware/tools/avr/bin/avrdude"{,_bin}
ln -s /usr/bin/avrdude "${PKG}/usr/share/arduino/hardware/tools/avr/bin/avrdude"
# Install desktop icons (keep a symlink for the arduino binary)
cp -a lib/icons/* "${PKG}/usr/share/icons/hicolor"
rm -rf "${PKG}/usr/share/arduino/lib/icons"
ln -s /usr/share/icons/hicolor "${PKG}/usr/share/arduino/lib/icons"
# Create desktop file using existing template
sed "s,<BINARY_LOCATION>,arduino %U,g;s,<ICON_NAME>,arduino,g" "lib/desktop.template" \
> "${PKG}/usr/share/applications/arduino.desktop"
# Install Arduino mime type
ln -s /usr/share/arduino/lib/arduino-arduinoide.xml "${PKG}/usr/share/mime/packages/arduino.xml"
}

View File

@ -0,0 +1,19 @@
# Description: AVRDUDE is an utility to download/upload/manipulate the ROM and EEPROM contents of AVR microcontrollers using the in-system programming technique (ISP)
# URL: http://www.nongnu.org/avrdude/
# Packager: milisarge
# Depends on : libftdi libusb-compat hidapi
name=avrdude
version=6.3
release=1
source=(http://download.savannah.gnu.org/releases/avrdude/${name}-$version.tar.gz)
build() {
cd ${name}-$version
./bootstrap
./configure --mandir=/usr/share/man \
--prefix=/usr \
--sysconfdir=/etc \
--enable-linuxgpio
make
make DESTDIR="$PKG" install
}

View File

@ -1,25 +1,26 @@
# Description: Records audio/data CD-Rs in disk-at-once (DAO) mode
# URL: http://cdrdao.sourceforge.net
# Packager: pierre at nutyx dot org
# Depends on:
# Packager: alihan-ozturk28@hotmail.com
# Depends on: lame libao libvorbis libmad
name=cdrdao
version=1.2.3
release=1
source=( http://downloads.sourceforge.net/$name/$name-$version.tar.bz2 \
http://downloads.nutyx.org/files/patchs/$name/cdrdao-1.2.3-stat.patch)
http://downloads.nutyx.org/files/patchs/$name/cdrdao-1.2.3-stat.patch)
build() {
cd $name-$version
patch -Np1 -i $SRC/cdrdao-1.2.3-stat.patch
CXXFLAGS+=' -std=c++11 -Wno-narrowing'
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--without-lame
--with-lame --with-xdao \
--with-ogg-support --with-mp3-support
make
make DESTDIR=$PKG install
make DESTDIR=$PKG install
}

View File

@ -0,0 +1,24 @@
# Description: Programming language designed at the Ericsson Computer Science Laboratory
# URL: http://erlang.org
# Packager: milisarge
# Depends on:
name=erlang
version=19.0
release=1
source=(http://erlang.org/download/otp_src_$version.tar.gz)
build(){
cd otp_src_$version
./configure --prefix=/usr \
--enable-threads \
--enable-smp-support \
--enable-kernel-poll \
--enable-hipe \
--enable-sctp \
make
make DESTDIR=$PKG install
find $PKG -name "README*" -delete
find $PKG -name "INSTALL" -delete
}

View File

@ -1,7 +1,6 @@
# Description: C++ based class library for building Graphical User Interfaces
# URL: http://www.fox-toolkit.org/
# Maintainers Jeroen van de Zijp <jeroen at fox-toolkit dot com>
# Packagers: pierre at nutyx dot org, tnut at nutyx dot org
# Packagers: milisarge
# Depends on: xorg-libxcursor xorg-libxft xorg-libxrandr xorg-libxxf86vm xorg-mesa cups xorg-glu
name=fox

View File

@ -0,0 +1,18 @@
# Description: A Simple library for communicating with USB and Bluetooth HID devices.
# URL: http://www.signal11.us/oss/hidapi/
# Packager: milisarge
# Depends on: libusb fox
name=hidapi
version=0.8.0-rc1
release=1
source=(https://github.com/signal11/hidapi/archive/$name-$version.tar.gz)
build() {
cd "$name-$name-$version"
./bootstrap
./configure --enable-testgui --prefix=/usr
make
make DESTDIR="$PKG/" install
}

View File

@ -0,0 +1,17 @@
# Description: General-purpose scalable concurrent malloc implementation
# URL: http://www.canonware.com/jemalloc/
# Packager: milisarge
# Depends on:
name=jemalloc
version=4.2.1
release=1
source=(https://github.com/jemalloc/jemalloc/releases/download/${version}/${name}-${version}.tar.bz2)
build() {
cd $name-$version
./configure --prefix=/usr
make
make DESTDIR=$PKG install
find "$PKG" -name \*.a -type f -exec chmod 644 '{}' \;
}

View File

@ -0,0 +1,16 @@
# Description: C-library for parsing configuration files
# URL: https://github.com/martinh/libconfuse
# Packager: milisarge
# Depends on :
name=libconfuse
_name=confuse
version=3.0
release=1
source=(https://github.com/martinh/libconfuse/releases/download/v3.0/confuse-3.0.tar.gz)
build() {
cd $_name-$version
./configure --prefix=/usr --enable-shared
make
make DESTDIR=$PKG install
}

View File

@ -0,0 +1,23 @@
# Description: A library to talk to FTDI chips, optional python bindings.
# URL: http://www.intra2net.com/en/developer/libftdi/download.php
# Packager: milisarge
# Depends on : libusb libconfuse boost cmake python swig
name=libftdi
version=1.3
release=1
source=(http://www.intra2net.com/en/developer/libftdi/download/${name}1-$version.tar.bz2)
build() {
cd ${name}1-$version
sed -i 's|LIB_SUFFIX 64|LIB_SUFFIX ""|' CMakeLists.txt
sed -i "s|MODE=\"0664\", GROUP=\"plugdev\"|TAG+=\"uaccess\"|g" packages/99-libftdi.rules
mkdir -p build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_SKIP_BUILD_RPATH=ON \
-DCMAKE_BUILD_TYPE=Release -DEXAMPLES=OFF -DFTDI_EEPROM=ON
make
make DESTDIR="$PKG" install
install -Dm644 "../packages/99-libftdi.rules" "$pkgdir/usr/lib/udev/rules.d/69-libftdi.rules"
# FS#45053
cp -r ../examples/* "$PKG/usr/share/libftdi/examples"
}

View File

@ -0,0 +1,25 @@
# Description: A safe, concurrent, practical language by Mozilla.
# URL: http://www.rust-lang.org/
# Packager: milisarge
# Depends on: libffi python jemalloc cmake
name=rust
version=1.11.0
release=1
source=(http://static.rust-lang.org/dist/rustc-$version-src.tar.gz)
build() {
cd rustc-$version
./configure --prefix=/usr \
--release-channel=stable \
--disable-docs \
--enable-ccache
make CFLAGS=" -fPIC -w"
make DESTDIR=$PKG install
cd "$PKG/usr/lib"
rm rustlib/{components,manifest-rustc,rust-installer-version}
ln -sf rustlib/x86_64-unknown-linux-gnu/lib/*.so .
}

View File

@ -0,0 +1,20 @@
# Description: VNC server for real X displays
# URL: http://www.karlrunge.com/x11vnc/
# PAckager: milisarge
# Depends on: libjpeg-turbo xorg-libxdamage xorg-libxinerama xorg-libxrandr xorg-libxtst
name=x11vnc
version=0.9.13
release=1
source=(http://prdownloads.sf.net/libvncserver/$name-$version.tar.gz)
build() {
cd $name-$version
CONFIG_SHELL=/bin/bash \
./configure --prefix=/usr \
--disable-nls \
--mandir=$PKG/usr/man
make
make prefix=$PKG/usr install
rm -rf $PKG/usr/{include,share}
}